//
//  ContributeScrollView.m
//  HorizonLight
//
//  Created by lanou on 15/10/10.
//  Copyright (c) 2015年 lanou. All rights reserved.
//

#import "ContributeScrollView.h"

@implementation ContributeScrollView


- (instancetype)initWithFrame:(CGRect)frame
{
    self.backgroundColor = [UIColor whiteColor];
    
    if (self = [super initWithFrame:frame])
    {
        self.backgroundColor = [UIColor whiteColor];
        
        self.nickNameTextField = [[UITextField alloc] initWithFrame:CGRectMake(20, 20, kScreenWidth - 40, 40)];
        _nickNameTextField.placeholder = @"昵称";
        _nickNameTextField.tag = 1000;
        [self setUpTextField:_nickNameTextField];
        
        
        self.eMailTextField = [[UITextField alloc] initWithFrame:CGRectMake(20, 80, kScreenWidth - 40, 40)];
        _eMailTextField.placeholder = @"邮箱(必填)";
        _eMailTextField.tag = 1001;
        [self setUpTextField:_eMailTextField];
        
        self.nameTextView = [[UITextView alloc] initWithFrame:CGRectMake(20, 140, kScreenWidth - 40, 100)];
        _nameTextView.layer.borderWidth = 1;
        _nameTextView.layer.cornerRadius = 5;
        _nameTextView.font = [UIFont systemFontOfSize:17];
        _nameTextView.tag = 1002;
        _nameTextView.layer.borderColor = [[UIColor colorWithWhite:0.75f alpha:0.5f] CGColor];
        [self addSubview:_nameTextView];
        
        
        self.videoNameLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth - 40, 30)];
        _videoNameLabel.text = @"视频名称 & 视频播放链接(必填)";
        _videoNameLabel.textColor = [UIColor lightGrayColor];
        _videoNameLabel.textAlignment = NSTextAlignmentCenter;
        [_nameTextView addSubview:_videoNameLabel];
        
    }
    return self;
}

//设置textField的属性
- (void)setUpTextField:(UITextField *)textField
{
    textField.borderStyle = 3;//设置边框
    textField.textAlignment = NSTextAlignmentCenter;//文本显示居中
    textField.returnKeyType = UIReturnKeyDone;//键盘右下角的按键
    textField.clearsOnBeginEditing = YES;//再次编辑就清空数据
    textField.keyboardType = UIKeyboardTypeDefault;//默认的键盘
    [self addSubview:textField];
}


/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
